<template>
    <panel title="账号添加">

        <accaddsunit @success="success"></accaddsunit>
    </panel>
</template>

<script>
import accaddsunit from './components/accountsunit.vue'
import axios from '@/utils/request';

export default {
    components: { accaddsunit },
    data() {
        return {

        }
    },
    methods: {
        success(addForm) {
            console.log(addForm);
            axios.post('/users/add', addForm).then((res) => {
                console.log(res, '---------');
                if (res.data.code == 0) {
                    this.$message({
                        message: '添加账号成功！',
                        type: 'success',
                    });
                    this.$router.push('/account/list')
                }
            })
        }
    }
}
</script>

<style lang="less" scoped>

</style>